package com.cn.plugin.mapper;

import com.cn.plugin.entity.Order;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @program: tenant-test
 * @author: Hydra
 * @create: 2020-12-20 18:45
 **/
public interface OrderMapper {

    @Select("select * from t_order where id=#{id}")
    Order selectByOrderId(@Param("id") Long id);

    @Select("select * from t_order where id=#{id} and status=#{status}")
    Order selectByOrderIdAndStatus(@Param("id") Long id,@Param("status")Integer status);

    @Select("select * from t_order")
    List<Order> selectAll();

    @Update("update t_order set status=2 where id=#{id}")
    int updateById(@Param("id") Long id);

}
